package com.hyf.translucentstatusbar.activity;

import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Window;

import com.hyf.translucentstatusbar.R;
import com.hyf.translucentstatusbar.app.MyApplication;
import com.hyf.translucentstatusbar.util.StatusBarUtils;

import butterknife.BindView;
import butterknife.ButterKnife;

public class TestStatusBarActivity extends AppCompatActivity {
    @BindView(R.id.hyf_dark_toolbar)
    Toolbar mToolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_test);
        ButterKnife.bind(this);
        int[] colors = {getResources().getColor(R.color.colorPrimary), getResources().getColor(R.color.colorPrimaryLight)};
        StatusBarUtils.setTranslucentStatusBar(this, new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT, colors), MyApplication.STATUS_BAR_ALPHA);
        mToolbar.setBackgroundDrawable(new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT, colors));
        mToolbar.setVisibility(View.VISIBLE);
        mToolbar.setTitle("TestStatusBarActivity");
    }
}
